package com.hj545.pl.bean;

import lombok.Data;

import java.io.Serializable;
import java.util.Objects;

/**
 * propertie
 * @author huangjian
 * @date 2018-02-16
 */
@Data
public class PropertieVO implements Serializable {

	private static final long serialVersionUID = -3708362404954741561L;

	private Long id;

	private String keyTitle;

	private String keyValue;

	private String keyName;

	private Long groupId;

	private String groupName;

	private Long projectId;

	private String projectName;

	private Long evnId;

	private String evnName;

	private Integer isEncrypted;

	private String concatName;

	private String remark;

	private String pcName;

	/**
	 * # keyTitle
	 * keyName = keyValue
	 * @return
	 */
	@Override
	public String toString() {
		String tmp = "";
		tmp += "# " + this.keyTitle + " " + noNull(this.remark) +  " ["
				+  noNull(this.evnName) + " " + noNull(this.pcName) +  "]\r\n";
		tmp += this.keyName + " = " + this.keyValue;
		return tmp;
	}

	private Object noNull(Object obj) {
		return Objects.isNull(obj) ? "" : obj;
	}

}
